import { createStore } from 'vuex'
import storage from '../utils/storage/index'
const userLocal=storage.localGet("currentUser");
const userInfo = userLocal&&JSON.parse(userLocal)||{};

export default createStore({
  state: {
    currentUser:userInfo,
    userInfo:{},
  },
  mutations: {
    setCurrentUser (state, value) {
      state.currentUser.id = value.id;
      state.currentUser.name=value.name;
      state.currentUser.password = value.password;
      state.currentUser.token = value.token
    },
    setUserInfo (state, value) {
      state.userInfo = value
    },
  },
  actions: {
  },
  modules: {
  }
})
